package com.lagou.module01.entity;

public class User {
    private int id;  //用户编号
    private String userName;  //用户名
    private String password;  //密码

    public User() {
    }

    //有参构造无需变量id  因为id是数据库中的主键，主键是自动增长的值
    public User(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    //重写toString方法不需要写id
    @Override
    public String toString() {
        return "User{" +
                "userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
